package meihua.stopcarapp.presenter;

import android.util.Log;

import meihua.mylibrary.baserx.RxSubscriber;
import meihua.stopcarapp.R;
import meihua.stopcarapp.presenter.contract.StopCarContract;

/**
 * Name: LGZ
 * Time: 2017/5/19.
 * Dec:
 */

public class StopCarPresenter extends StopCarContract.Presenter {
    @Override
    public void getChargingRequest(String order_num, String parking_list_num) {
        mRxManage.add(mModel.getCharging(order_num, parking_list_num)
                .subscribe(new RxSubscriber<String>(mContext,false) {
                    @Override
                    public void onStart() {
                        super.onStart();
                        mView.showLoading(mContext.getString(R.string.loading));
                    }
                    @Override
                    protected void _onNext(String entity) {
                        Log.d("ligaozeng","请求成功");
                        mView.returnCharging(entity);
                        mView.stopLoading();
                    }
                    @Override
                    protected void _onError(String message) {
                        Log.d("ligaozeng","服务器错误:"+message);
                    }
                }));
    }
}
